-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #299, Sleep before exit when printing #301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has come up a time or two, the root of the problem is really that OS_printf is now always associated with a background task/local OSAL bufffer to do the output. This makes it so its always buffered consistently across platforms.
The price of that consistency, is that in previous versions, OS_printf on POSIX was just directly going to the libc printf, but now it's got an extra buffer in the middle.
Rather than adding a blanket delay - which is not ideal as its much longer than it really needs to be, while also not even guaranteeing that the output was flushed - since this is the PC-Linux PSP, and therefore known to be running on this platform, we should be using some form of perror
here, or at least converting to fprintf(stderr, ...
.
Note that stderr stream is unbuffered, so there should not be any problem with immediately calling exit()
afterwards.
Another option/suggestion would be to use the |
Also note that if we are touching these error message, I would like to see it report the actual errno in some form (at least the number, but preferably the string as obtained from |
FYI: I wrote issue #302 so as to not forget about this, it doesn't have to be part of this PR necessarily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the CFE_PSP_Panic suggestion to replace the OS_TaskDelay and exit.
Ok, thanks for all the information. I have now used CFE_PSP_Panic as well as perror to handle the error. |
879ea05
to
f587528
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good!
Only required cleanup now is to squash down the multiple commits and rewrite the log message for merging.
Ok, great.
Of course, it is already done. I will push it right away. |
f587528
to
bf9b935
Compare
CCB:2021-10-13 APPROVED |
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored by: Jacob Hageman [email protected] Co-authored by: Joseph Hickey [email protected] Co-authored by: Ariel Adams [email protected] Co-authored by: Paul [email protected] Co-authored by: Zachary Gonzalez [email protected] Co-authored by: Sam Price [email protected] Co-authored by: Shefali Sharma [email protected]
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored by: Jacob Hageman <[email protected]> Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Ariel Adams <[email protected]> Co-authored by: Paul <[email protected]> Co-authored by: Zachary Gonzalez <[email protected]> Co-authored by: Sam Price <[email protected]> Co-authored by: Shefali Sharma <[email protected]>
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Zachary Gonzalez <[email protected]> Co-authored-by: Sam Price <[email protected]> Co-authored-by: Shefali Sharma <[email protected]>
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Zachary Gonzalez <[email protected]> Co-authored-by: Sam Price <[email protected]> Co-authored-by: Shefali Sharma <[email protected]>
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Zachary Gonzalez <[email protected]> Co-authored-by: Sam Price <[email protected]> Co-authored-by: Shefali Sharma <[email protected]>
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 Includes: - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Zachary Gonzalez <[email protected]> Co-authored-by: Sam Price <[email protected]> Co-authored-by: Shefali Sharma <[email protected]>
Combines: nasa/cFE#2001 nasa/osal#1191 nasa/PSP#318 nasa/ci_lab#101 nasa/sch_lab#102 nasa/to_lab#112 nasa/sample_app#163 nasa/cFS-GroundSystem#201 nasa/elf2cfetbl#98 Includes: *cFE* - nasa/cFE#1663, Use cfe time clock state enum t in cmd/tlm and handling - nasa/cFE#1973, EVS functional test add for different event types - nasa/cFE#1954, Patch for recursive event loop - nasa/cFE#1911, CFE_ES_MemAddOff structure to associated CFE_ES_MemAddress_t and CFE_ES_MemOffset_t - nasa/cFE#1986, Avoid aliasing warnings - nasa/cFE#1975, Message ID type improvements - nasa/cFE#1974, CFE_SB_ValueToMsgId/MsgIdToValue wrappers - nasa/cFE#1663, Use CFE_TIME_ClockState_Enum_t in cmd/tlm and handling - nasa/cFE#1995, Consolidate repeated MSG stub setup in sb_UT - nasa/cFE#1873, Return type conversions in CFE_ES_GetTaskName - nasa/cFE#1966, Better message type pointer conversion - nasa/cFE#2002, Replacing hardcoded message limit in TIME services - nasa/cFE#1909, Use macro in CFE_ResourceId_IsDefined - nasa/cFE#1999, Checking against IsNewOffset only *osal* - nasa/osal#1186, Add Duplicate Check to Local Unit Test - nasa/osal#1178, Rename OS_XXXTime to OS_XXXLocalTime in comments - nasa/osal#1168, Fix vxWorks intLib stub aliasing issue - nasa/osal#1169, Recognize ifdef __cplusplus - nasa/osal#1180, Remove extern in stub prototypes - nasa/osal#1112, Add typedef for OSAL status codes *PSP* - nasa/PSP#301, Sleep before exit when printing - nasa/PSP#314, Check the address in PSP get segment stubs *Tools* - nasa/elf2cfetbl#89, Check get_sh_entsize(SectionHeader) value - nasa/elf2cfetbl#93, Check get_sh_entsize(SectionHeader) value - nasa/cFS-GroundSystem#197, Free Address Info for Leak *Apps* - nasa/sch_lab#95, use separate address variable - nasa/sch_lab#94, Use CFE_MSG_PTR conversion macro - nasa/sample_app#157, Use CFE_MSG_PTR conversion macro - nasa/ci_lab#95, Use CFE_MSG_PTR conversion macro - nasa/to_lab#107, Use CFE_MSG_PTR conversion macro Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Ariel Adams <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Zachary Gonzalez <[email protected]> Co-authored-by: Sam Price <[email protected]> Co-authored-by: Shefali Sharma <[email protected]>
Describe the contribution
Expected behavior changes
Additional context
Contributor Info - All information REQUIRED for consideration of pull request
Paul Oberosler, Individual